package com.saodisheng.service;

import com.jfinal.kit.Ret;
import com.jfinal.plugin.activerecord.Page;
import com.saodisheng.model.PostsComment;

/**
 * description: 评论
 *
 * @author 扫地生_saodisheng
 * @date 2022/1/29
 */
public interface CommentService {
	/**
	 * 保存评论及回复
	 */
	Ret saveReply(Integer postId, Integer myId, String content);
	
	/**
	 * 获取评论
	 * select sr.*, a.nickName, a.avatar from share_reply sr inner join user a on sr.accountId = a.id where shareId = 13;
	 */
	Page<PostsComment> getReplyPage(int postId, int pageNumber);
	
	/**
	 * 获取某用户的评论及评论post详情
	 */
	Page<PostsComment> getCommentAndPost(int pageNum, int userId);
	
	/**
	 * 获取评论数
	 */
	int getComments(int postId);
}
